# -*- coding: utf-8 -*-
# !/usr/bin/env python

# -*- coding: utf-8 -*-
# !/usr/bin/env python
import uvicorn
from fastapi import Depends, FastAPI, Query, Header, Cookie, Form, File, UploadFile
from pydantic import BaseModel
from typing import Optional
import apps.analysis as analysis
import apps.users as users
import apps.report as report
from starlette.requests import Request
from starlette.responses import RedirectResponse
from starlette.staticfiles import StaticFiles
from starlette.templating import Jinja2Templates
from starlette.responses import FileResponse

app = FastAPI()

templates = Jinja2Templates(directory="./templates")
app.mount("/static", StaticFiles(directory="./static"), name="static")
app.include_router(analysis.main.router, prefix="/analysis", tags=["数据分析"])
app.include_router(users.main.router, prefix="/users", tags=["用户分析"])
app.include_router(report.main.router, prefix="/report", tags=["分析报告"])


@app.get('/')
def index():
    return {'data': [1, 2, 3, 4, 5, 6]}


# @app.get('/')
# def homepage(request: Request):
#     return templates.TemplateResponse('./homepage/index.html', {'request': request})


if __name__ == '__main__':
    uvicorn.run("main:app", host='0.0.0.0', port=5000, debug=True)
